package leetcode.linkedList.p203;
public class ListNode {
	int val;
	ListNode next;
	ListNode(int x) {
		val = x;
	}
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        ListNode cur = this;
        while (cur != null) {
            sb.append(cur.val + "->");
            cur = cur.next;
        }
        
        return sb.append("NULL").toString();
    }
}